<template>
    <div class="app">
        <myNavbar title="订单确认"></myNavbar>
        <list>
            <cell>
                <!-- 配送方式 -->
                <div class="submit_package" @click="deliveryClick" v-if="shippingMethods.length != 0">
                    <text class="submit_payMethod_Content_Title">配送方式</text>
                    <div style="display:flex;flex-direction:row;align-item:center">
                        <div style="display:flex;flex-direction:row;align-item:center">
                            <text class="submit_product_details_subtitle">{{ delivery.title }}</text>
                        </div>
                        <icon content="ios-arrow-forward" class="submit_product_details_Icon"></icon>
                    </div>
                </div>
                <div>
                    <div class="address_box" v-if="shippingMethod !=1">
                        <div @click="addressClick" v-if="address != null">
                            <div class="address_top">
                                <div class="address_label" v-if="address.isDefault == true">
                                    <div class="address_label_item">
                                        <text class="address_label_title">默认</text>
                                    </div>
                                </div>
                                <text class="address_name">{{ address.consignee }}</text>
                                <text class="address_phone">{{ address.phone }}</text>
                            </div>
                            <text class="address_content">{{ address.address }}</text>
                            <div class="address_right">
                                <icon content="ios-arrow-forward" class="address_right_icon"></icon>
                            </div>
                        </div>
                        <div class="address_no" @click="addressClick" v-if="address == null">
                            <image class="address_no_img"
                                   src="http://rzico.oss-cn-shenzhen.aliyuncs.com/v4.0/wallet-income.png"></image>
                            <text class="address_no_title">添加收货人信息</text>
                        </div>
                    </div>
                </div>
                <div class="submit_package" v-if="invitationcode!==''">
                    <text class="submit_payMethod_Content_Title_code">邀请人</text>
                    <div style="display:flex;flex-direction:row;align-item:center">
                        <div style="display:flex;flex-direction:row;align-item:center">
                            <input class="phone_input" placeholder="请输入邀请人" v-model="invitationcode"/>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="address_box" v-if="shippingMethod ==1">
                        <div class="shop_box" style="padding-top:10px;" @click="siteClick">
                            <text class="shop_title">提货门店</text>
                            <div style="display:flex;align-items:center;flex-direction: row">
                                <div style="width:420px">
                                    <div style="display:flex;justify-content: flex-end;flex-direction: row">
                                        <text class="shop_name">{{ shopName }}</text>
                                    </div>
                                    <text class="shop_name"
                                          v-if="(shopAddress != null || shopAreaName != null) && shopName != '请选择提货点'">
                                        {{ shopAreaName }}{{ shopAddress }}
                                    </text>
                                </div>
                                <icon content="ios-arrow-forward" class="submit_product_details_Icon"></icon>
                            </div>
                        </div>
                        <div class="shop_box" style="padding-top:10px;">
                            <text class="shop_title">提货人手机</text>
                            <input style="font-size:28px;color: rgba(26, 26, 30, 0.3);text-align:right;width: 400px;height: 40px;"
                                   placeholder="请输入提货人手机号码" v-model="calculate.phone"/>
                        </div>
                        <div class="shop_box" style="padding-top:10px;">
                            <text class="shop_title">提货人姓名</text>
                            <input
                                    style="font-size:28px;color:rgba(26, 26, 30, 0.3);display:flex;align-items: flex-end;justify-content: flex-end;text-align:right;width: 400px;height: 40px;"
                                    placeholder="请输入提货人的姓名" v-model="calculate.consignee"/>
                        </div>
                    </div>
                </div>
                <!-- 套餐配送时间 -->
                <div class="submit_package" @click="packageClick" v-if="bomType == 1">
                    <text class="submit_payMethod_Content_Title">配送时间</text>
                    <div style="display:flex;flex-direction:row;align-item:center">
                        <div style="display:flex;flex-direction:row;align-item:center" v-for="(item,index) in weexDate">
                            <text class="submit_product_details_subtitle">{{ item.title }}</text>
                            <text class="submit_product_details_subtitle" v-if="index+1 != weexDate.length">、</text>
                        </div>
                        <icon content="ios-arrow-forward" class="submit_product_details_Icon"></icon>
                    </div>
                </div>
                <div class="submit_product">
                    <div class="submit_product_content_box" v-for="item in calculate.itemList">
<!--                      {{item}}-->
<!--                      {{calculate}}-->

                      <image class="submit_product_content_img" :src="item.thumbnail"></image>
                        <div class="submit_product_content">
                            <text class="submit_product_content_title">{{ item.name }}</text>
                            <text class="submit_product_content_subtitle">{{ item.spec }}</text>
                            <div class="submit_product_content_row">
                            </div>
                        </div>
                        <div class="submit_product_number">
                            <div style="display:flex;flex-direction:row;justify-content: flex-end" v-if="item.point>0">
                                <text class="submit_product_yellow_priceIcon">兑换券:</text>
                                <text class="submit_product_yellow_priceIcon">{{ item.point | number}}</text>
                            </div>
                          <div style="display:flex;flex-direction:row;justify-content: flex-end" v-else>
                            <text class="submit_product_priceIcon">¥</text>
                            <text class="submit_product_priceTitle">{{ item.price }}</text>
                          </div>

                            <div style="display:flex;flex-direction:row;">
                                <text class="submit_product_quantity">x {{ item.quantity }}</text>
                            </div>
                        </div>
                    </div>
                    <div class="submit_product_details">
                        <text class="submit_product_details_title">运费</text>
                        <div class="submit_product_detailsBox">
                            <text class="submit_product_details_subtitle"></text>
                            <div>
                                <!--<text class="submit_product_details_IntroductionTwo" v-if="calculate.freight==0">包邮-->
                                <!--</text>-->
                                <text class="submit_product_details_IntroductionTwo">
                                    ¥{{ calculate.freight | price}}
                                </text>
                            </div>
                        </div>
                    </div>
                    <div class="submit_product_details" @click="couponsClick">
                        <text class="submit_product_details_title">店铺优惠</text>
                        <div class="submit_product_detailsBox">
                            <div style="display:flex;flex-direction:row;align-item:center">
                                <text class="submit_product_details_IntroductionTwo" v-if="promotionsOff">
                                    {{ promotionsTitle }}
                                </text>
                                <text class="submit_product_details_IntroductionTwo" v-else>无优惠</text>
                                <icon v-if="calculate.discount>0" content="ios-arrow-forward"
                                      class="submit_product_details_Icon"></icon>
                            </div>
                        </div>
                    </div>
                    <div class="submit_product_details">
                        <text class="submit_product_details_title">订单备注</text>
                        <div class="submit_product_detailsBox">
                            <input class="submit_product_detailsBox_input" v-model="calculate.memo"
                                   placeholder="选填，请先和商家协商一致"/>
                        </div>
                    </div>
                  <div class="submit_subtotal" v-if="calculate.subPoint>0">
                    <text class="submit_subtotal_subtitle" >共{{ calculate.subQuantity }}件</text>
                    <text class="submit_subtotal_title">兑换券：</text>
                    <text class="submit_subtotal_Icon">¥</text>
                    <text class="submit_subtotal_price">{{ calculate.subPoint }}</text>
                  </div>
                    <div class="submit_subtotal" v-else>
                        <text class="submit_subtotal_subtitle">共{{ calculate.subQuantity }}件</text>
                        <text class="submit_subtotal_title">小计：</text>
                        <text class="submit_subtotal_Icon">¥</text>
                        <text class="submit_subtotal_price">{{ calculate.amountPayable }}</text>
                    </div>
                </div>
                <div class="submit_payMethod">
                    <div class="submit_payMethod_Header">
                        <text class="submit_payMethod_Header_Title">支付方式</text>
                    </div>
                    <div class="submit_payMethod_Content" v-for="(item,index) in calculate.paymentVo">
                        <div class="submit_payMethod_Content_Column">
                            <text class="submit_payMethod_Content_Title">{{ item.paymentPluginName }}</text>
                            <div style="display: flex;flex-direction: row;align-items: center">
                                <text class="submit_payMethod_Content_SubTitle" v-if="item.paymentPluginId == 'groupPayPlugin'">使用 {{ item.quantity
                                    }} 兑换券
                                </text>
                                <text class="submit_payMethod_Content_SubTitle" v-if="item.paymentPluginId != 'groupPayPlugin'">可使用 ¥{{ item.balance
                                    }} 已使用 ¥{{ item.amount }}
                                </text>
                                <text style="margin-left:10px;" class="submit_payMethod_Content_Date"
                                      v-if="item.quantity !=underfind && (item.paymentPluginId == 'waterTicketPayPlugin' || item.paymentPluginId == 'couponCodePayPlugin')">
                                    (已使用{{ item.quantity }}张)
                                </text>
                            </div>
                            <text class="submit_payMethod_Content_Date" v-if="item.endDate !=underfind">
                                有效期至：{{ item.endDate | formatTime }}
                            </text>
                        </div>
                        <switch :checked="item.chk" :disabled="item.chkType" @click="changeClick(index)"></switch>
                    </div>
                </div>
                <div>
                    <div class="submit_payMethod" v-if="amount>0">
                        <div class="submit_payMethod_ContentTwo" v-if="amount>0">
                            <div class="submit_payMethod_Content_Row">
                                <div>
                                    <image class="submit_payMethod_Content_Img"
                                           src="http://rzico.oss-cn-shenzhen.aliyuncs.com/img/zhifubao.png"></image>
                                </div>
                                <text class="submit_payMethod_Content_Title">支付宝支付</text>
                            </div>
                            <switch :checked="alipayPay" :key="tmies" @change="payClick('alipayPay')"></switch>
                        </div>
                        <div class="submit_payMethod_ContentTwo" style="margin-top:30px" v-if="amount>0">
                            <div class="submit_payMethod_Content_Row">
                                <div>
                                    <image class="submit_payMethod_Content_Img"
                                           src="http://rzico-weex.oss-cn-hangzhou.aliyuncs.com/images/wxpayImg.png"></image>
                                </div>
                                <text class="submit_payMethod_Content_Title">微信支付</text>
                            </div>
                            <switch :checked="weixinPay" :key="tmies" @change="payClick('weixinPay')"></switch>
                        </div>
                        <!--<div class="submit_payMethod_ContentTwo" style="margin-top:30px">-->
                        <!--<div class="submit_payMethod_Content_Row">-->
                        <!--<div>-->
                        <!--<image class="submit_payMethod_Content_Img"-->
                        <!--src="http://rzico.oss-cn-shenzhen.aliyuncs.com/eeuiApp/release/unionPay.png"></image>-->
                        <!--</div>-->
                        <!--<text class="submit_payMethod_Content_Title">云闪付支付</text>-->
                        <!--</div>-->
                        <!--<switch :checked="unionPay" :key="tmies" @change="payClick('unionPay')"></switch>-->
                        <!--</div>-->
                    </div>
                </div>
                <div style="width:750px;height:130px;"></div>
                <div class="submit_botton">
                    <text class="submit_botton_subtitle">共{{ calculate.subQuantity }}件 合计</text>
                    <text class="submit_botton_icon">¥</text>
                    <text class="submit_botton_price">{{ amount }}</text>
                    <div class="submit_botton_box botton_Bg_Color" @click="createClick" v-if="payType == false">
                        <text class="submit_botton_box_title botton_Fz_Color">提交订单</text>
                    </div>
                    <div class="submit_botton_box_no" v-if="payType == true">
                        <text class="submit_botton_box_title botton_Fz_Color">提交订单</text>
                    </div>
                </div>
                <!--                <div class="submit_isMask" v-if="submitType == false">-->
                <!--                    <div class="submit_isMask_content">-->
                <!--                        <div class="submit_isMask_header">-->
                <!--                            <text class="submit_isMask_header_title">抱歉，您本单购买的四件商品超出配送范围</text>-->
                <!--                        </div>-->
                <!--                        <list style="max-height: 800px">-->
                <!--                            <cell v-for="item in check_shippingData">-->
                <!--                                <div class="submit_isMask_product">-->
                <!--                                    <image class="submit_isMask_product_img" :src="item.thumbnail"></image>-->
                <!--                                    <div class="submit_isMask_product_column">-->
                <!--                                        <text class="submit_isMask_product_title">{{item.name}}</text>-->
                <!--                                        <text class="submit_isMask_product_subtitle">{{item.spec}}</text>-->
                <!--                                        <text class="submit_isMask_product_quantity">x {{item.quantity}}</text>-->
                <!--                                    </div>-->
                <!--                                </div>-->
                <!--                            </cell>-->
                <!--                            <div style="widht:670px;height:140px"></div>-->
                <!--                            <div class="isMask_botton">-->
                <!--                                <div class="isMask_botton_left" @click="returnClick">-->
                <!--                                    <text class="isMask_botton_left_title">返回</text>-->
                <!--                                </div>-->
                <!--                                <div class="isMask_botton_right botton_Bg_Color" @click="completeClick">-->
                <!--                                    <text class="isMask_botton_right_title botton_Fz_Color">一键去除</text>-->
                <!--                                </div>-->
                <!--                            </div>-->
                <!--                        </list>-->
                <!--                    </div>-->
                <!--                </div>-->
                <packageName v-if="packageType==true" @packageClose="packageClose" @saveClick="saveClick"></packageName>
                <selectBox @cencleDelivery="cencleDelivery" @completeDelivery="completeDelivery"
                           v-if="deliveryType == true"
                           :shippingMethod="shippingMethod" :shippingMethods="shippingMethods"></selectBox>
                <coupons :couponCodeName="couponCodeName" :promotions="calculate.promotions"
                         @cenclecoupons="cenclecoupons"
                         v-if="couponsType == true"></coupons>
                <shippingSite ref="shippingSite1" @cencleSite="cencleSite" @completeSite="completeSite"
                              v-if="siteType == true"></shippingSite>
            </cell>
        </list>
    </div>
</template>

<script>
    var modal = app.requireModule('modal')
    import {
        build,
        create,
        calculate,
        payment,
        check_shipping,
        shopList
    } from '../../../api/order';
    import {
        submit,
        query
    } from '../../../api/payment';
    import {
        list
    } from '../../../api/address';
    import selectBox from './components/SelectBox.vue'
    import coupons from './components/coupons.vue'
    import packageName from './components/package.vue'

    const pay = app.requireModule("eeui/pay");
    import myNavbar from '../../../components/myNavbar/myNavbar.vue'
    import shippingSite from '../../../components/shippingSite/shippingSite.vue'

    const storage = weex.requireModule('storage')
    export default {
        data() {
            return {
                invitationcode: "",
                calculate: {},
                delivery: {
                    title: ''
                },
                weexDate: [{
                    title: '请选择配送日期'
                }],
                bomType: 0,
                deliveryType: false,
                couponsType: false,
                packageType: false,
                // coupons: null,
                weexTime: '',
                submitType: false,
                address: null,
                order_Details: {
                    address: null
                },
                sn: '',
                orderId: '',
                giftCardId: '',
                amount: 0,
                shippingMethods: [],
                shippingMethod: '',
                distribution: [],
                paymentVo: [],
                check_shippingData: [],
                payType: false,
                couponCodeName: '',
                alipayPay: true,
                weixinPay: false,
                unionPay: false,
                siteType: false,
                shopId: '',
                shopName: '请选择提货点',
                shopIndex: '0',
                shopAddress: null,
                shopAreaName: null,
                promotionsOff: false,
                promotionsTitle: "",
                tmies: null,
                groupId: "",
                auctionId:''
            }
        },
        created() {
            if (app.config.params) {
                this.giftCardId = app.config.params
            }
            //区分是否为团购
            if (app.config.params) {
                this.groupId = app.config.params.groupId
              this.auctionId = app.config.params.auctionId
              if (!this.isNull(this.groupId)) {
                    console.info('444444444444444');
                    console.info(this.groupId);
                    this.grouploadBuild()
                }
              if (!this.isNull(this.auctionId)) {
                console.info('auctionIdauctionIdauctionIdauctionIdauctionId');
                console.info(this.auctionId);
                this.grouploadBuild()
              }
            } else {
                this.loadBuild()
            }
        },
        components: {
            selectBox,
            packageName,
            coupons,
            myNavbar,
            shippingSite
        },
        filters: {
            formatTime(value) {
                let date = new Date(value);
                let y = date.getFullYear();
                let MM = date.getMonth() + 1;
                MM = MM < 10 ? ('0' + MM) : MM;
                let d = date.getDate();
                d = d < 10 ? ('0' + d) : d;
                let h = date.getHours();
                h = h < 10 ? ('0' + h) : h;
                let m = date.getMinutes();
                m = m < 10 ? ('0' + m) : m;
                let s = date.getSeconds();
                s = s < 10 ? ('0' + s) : s;
                return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
            },
            price(value) {
                var toFixedNum = Number(value).toFixed(3);
                var realVal = toFixedNum.substring(0, toFixedNum.toString().length - 1);
                return realVal;
            },
        },
        methods: {
            saveClick(data) {
                var _this = this
                _this.weexDate = []
                _this.weexTime = data.weexTime
                if (data.weexData.length != 0) {
                    _this.weexDate = data.weexData
                } else {
                    _this.weexDate = [{
                        title: '请选择配送日期'
                    }]
                }
                this.packageType = false

            },
            packageClick() {
                this.packageType = true
            },
            packageClose() {
                this.packageType = false
            },
            addressClick() {
                var _this = this
                eeui.openPage({
                    url: 'root://pages/member/address/address.js',
                    params: 'product',
                    statusBarType: 'immersion',
                    statusBarStyle: false
                }, (result) => {
                    if (result.status == 'stop') {
                        storage.getItem('address', event => {
                            if (event.result == 'success') {
                                _this.address = JSON.parse(event.data)
                                _this.calculate.address = _this.address.address
                                _this.calculate.receiverId = _this.address.id
                                _this.calculate.areaName = _this.address.areaName
                                _this.calculate.consignee = _this.address.consignee
                                _this.calculate.phone = _this.address.phone
                                _this.calculateClick(_this.calculate)
                            }
                        })
                    }
                })
            },
            grouploadBuild() {
                var _this = this

                let params = {
                  uuid: this.getGlobalData().uuid,
                  giftCardId: "",
                  // groupBuyId: this.groupId,
                  // auctionId:this.auctionId
                }
                if( this.groupId != null){
                  params.groupBuyId = this.groupId
                }
              if( this.auctionId != null){
                params.auctionId = this.auctionId
              }
                build(params).then(
                    res => {
                        if (res.type == 'success') {
                            if (!_this.isNull(res.data.code)) {
                                _this.invitationcode = res.data.code
                            }
                            _this.calculate = res.data.order;
                            if (_this.calculate.promotions.length > 0) {
                                _this.promotionsOff = true
                                _this.promotionsTitle = _this.calculate.promotions[0].title
                            }
                            _this.order_Details = res.data.order;
                            _this.order_Details.amountPaid = 0;
                            if (!this.isEmptyString(res.data.shippingMethods)) {
                                _this.shippingMethods = res.data.shippingMethods.split(",")
                                _this.shippingMethods.forEach(function (item) {
                                    if (item == 0) {
                                        var distribution = {
                                            title: '普通快递',
                                            status: false,
                                            id: 0,
                                        }
                                        _this.distribution.push(distribution)
                                    } else if (item == 1) {
                                        var distribution = {
                                            title: '到店核销',
                                            status: false,
                                            id: 1,
                                        }
                                        _this.distribution.push(distribution)
                                    } else if (item == 2) {
                                        var distribution = {
                                            title: '同城配送',
                                            status: false,
                                            id: 2,
                                        }
                                        _this.distribution.push(distribution)

                                    }
                                })
                                _this.delivery.title = _this.distribution[0].title
                                _this.shippingMethod = _this.distribution[0].id
                                _this.calculate.shippingMethod = _this.distribution[0].id
                            }
                            _this.loadList()
                        }
                    }
                ).catch(error => {

                })
            },
            loadBuild() {
                var _this = this
                build({
                    uuid: this.getGlobalData().uuid,
                    giftCardId: this.giftCardId,
                }).then(
                    res => {
                        if (res.type == 'success') {
                            _this.calculate = res.data.order;
                            if (_this.calculate.promotions.length > 0) {
                                _this.promotionsOff = true
                                _this.promotionsTitle = _this.calculate.promotions[0].title
                            }
                            _this.order_Details = res.data.order;
                            _this.order_Details.amountPaid = 0;
                            if (!this.isEmptyString(res.data.shippingMethods)) {
                                _this.shippingMethods = res.data.shippingMethods.split(",")
                                _this.shippingMethods.forEach(function (item) {
                                    if (item == 0) {
                                        var distribution = {
                                            title: '普通快递',
                                            status: false,
                                            id: 0,
                                        }
                                        _this.distribution.push(distribution)
                                    } else if (item == 1) {
                                        var distribution = {
                                            title: '到店核销',
                                            status: false,
                                            id: 1,
                                        }
                                        _this.distribution.push(distribution)
                                    } else if (item == 2) {
                                        var distribution = {
                                            title: '同城配送',
                                            status: false,
                                            id: 2,
                                        }
                                        _this.distribution.push(distribution)

                                    }
                                })
                                _this.delivery.title = _this.distribution[0].title
                                _this.shippingMethod = _this.distribution[0].id
                                _this.calculate.shippingMethod = _this.distribution[0].id
                            }
                            _this.loadList()
                        }
                    }
                ).catch(error => {
                    console.log(error)
                })
            },
            loadList() {
                var _this = this
                var defaultAddress = []
                list({
                    mchId: this.getGlobalData().mchId
                }).then(res => {
                    res.data.data.forEach(function (item) {
                        if (item.isDefault == true) {
                            defaultAddress.push(item)
                        }
                    })
                    if (!this.isEmptyString(defaultAddress)) {
                        _this.address = defaultAddress[0]
                    } else {
                        _this.address = res.data.data[0]
                    }
                    if (_this.address != null) {
                        _this.calculate.address = _this.address.address
                        _this.calculate.receiverId = _this.address.id
                        _this.calculate.areaName = _this.address.areaName
                        _this.calculate.consignee = _this.address.consignee
                        _this.calculate.phone = _this.address.phone
                    }
                    _this.calculateClick(_this.calculate)
                }).catch(error => {
                })
            },
            calculateClick(data) {

                var _this = this
                var form = eval(data)
                form.paymentVo.forEach(function (item) {
                    var vform = delete eval(item).chkType
                })

                calculate(form).then(
                    res => {
                        if (res.type == 'success') {
                            this.calculate = res.data.order

                            this.bomType = res.data.bomType
                            this.amount = res.data.amount
                            _this.initCard(res.data.order.paymentVo, this.calculate.amountPayable)
                            _this.calculate.itemList.forEach(function (item) {
                                item.thumbnail = _this.thumbnail(item.thumbnail, 170, 170)
                            })
                            if (!this.isEmptyString(res.data.couponCodeName)) {
                                _this.couponCodeName = res.data.couponCodeName
                            }

                            if(this.calculate.subPoint>0){
                                this.alipayPay=false
                                this.weixinPay=false
                                this.amount = 0
                                this.paymentVo.forEach(function (item) {
                                    item.chk = true;
                                    item.chkType = true;
                                    item.amount = item.balance
                                })
                            }
                        }
                    }
                ).catch(error => {

                })
            },

            //盘
            initCard(cardInfo, amountPayable) {
                var _this = this
                //设置福利卡以到期时间进行排序，时间越近越靠前
                for (let i = 0; i < cardInfo.length; i++) {
                    for (let j = 0; j < cardInfo.length - 1 - i; j++) {
                        if (cardInfo[j].endDate > cardInfo[j + 1].endDate) {
                            let temp = cardInfo[j];
                            cardInfo[j] = cardInfo[j + 1];
                            cardInfo[j + 1] = temp;
                        }
                    }
                }
                //设置福利卡支付金额，避免超额支付
                var unpayAmount = this.amount - 0
                cardInfo.forEach(function (item) {
                    if (0 < unpayAmount) {
                        item.chk = false
//          if (item.balance > unpayAmount) {
                        item.amount = 0; // unpayAmount
//            unpayAmount = 0
//          } else {
//            item.amount = item.balance
//            unpayAmount -= item.balance
//          }
                    }
                })
                this.paymentVo = cardInfo
                this.amount = Number(unpayAmount).toFixed(2)

            },

            changeClick(index) {
                var _this = this
                var paymentPluginId = _this.calculate.paymentVo[index].paymentPluginId
                if (_this.calculate.paymentVo[index].chk == false) {
                    if (_this.amount > 0) {
                        if (paymentPluginId == 'waterTicketPayPlugin' || paymentPluginId == 'couponCodePayPlugin' || paymentPluginId == 'groupPayPlugin') {
                            var amount = 0
                            _this.calculate.paymentVo.forEach(function (item) {
                                amount += Number(item.amount)
                                item.amount = 0
                                item.chk = false
                            })
                            amount = Number(amount) + Number(_this.amount)
                            _this.calculate.paymentVo[index].amount = _this.calculate.paymentVo[index].balance
                            _this.calculate.paymentVo[index].chk = true
                            _this.amount = amount - _this.calculate.paymentVo[index].amount
                            if (_this.amount == 0) {
                                _this.calculate.paymentVo.forEach(function (item) {
                                    if (item.amount == 0) {
                                        item.chkType = true
                                    }
                                })
                                _this.$forceUpdate()
                            }
                        } else {

                            if (Number(_this.amount) >= Number(_this.calculate.paymentVo[index].balance)) {

                                _this.amount = (Number(_this.amount) - Number(_this.calculate.paymentVo[index].balance)).toFixed(2)
                                _this.calculate.paymentVo[index].amount = _this.calculate.paymentVo[index].balance
                                if (_this.amount == 0) {
                                    _this.calculate.paymentVo.forEach(function (item) {
                                        if (item.amount == 0) {
                                            item.chkType = true
                                        }
                                    })
                                    _this.$forceUpdate()
                                }

                            } else {

                                _this.calculate.paymentVo[index].amount = _this.amount
                                _this.amount = 0;
                                _this.calculate.paymentVo.forEach(function (item) {
                                    if (item.amount == 0) {
                                        item.chkType = true
                                    }
                                })
                                _this.$forceUpdate()

                            }

                            _this.calculate.paymentVo[index].chk = true;

                        }

                    } else {
                        var amount = Number(_this.calculate.amountPayable)
                        _this.calculate.paymentVo[index].amount = _this.calculate.paymentVo[index].balance
                        _this.amount = amount - _this.calculate.paymentVo[index].amount
                        if (_this.amount == 0) {
                            _this.calculate.paymentVo.forEach(function (item) {
                                if (item.amount == 0) {
                                    item.chkType = true
                                }
                            })
                            _this.$forceUpdate()
                        }
                        _this.calculate.paymentVo[index].chk = true;
                    }
                } else {
                    _this.calculate.paymentVo[index].chk = false
                    _this.calculate.paymentVo[index].amount = 0
                    _this.calculate.paymentVo.forEach(function (item) {
                        item.chkType = false
                    })
                    _this.$forceUpdate()
//          var checkAmount = 0
//        let checkOff = true //检查是否有被选中的福利金项
//      _this.calculate.paymentVo.forEach(function (item) {
//        if (item.chk) {
//          checkOff = false
//          //计算选中的金额总和
//          checkAmount += Number(item.amount)
//          //计算待支付的金额
//          _this.amount = Number(_this.calculate.amountPayable) - Number(checkAmount)
//          if (0 <= _this.amount) {
//            item.amount = item.balance
//          } else {
//            item.amount = Number(_this.calculate.amountPayable) - Number(checkAmount) + Number(item.balance)
//            _this.amount = 0
//          }
//        }
//      })
//      if(checkOff){
//        _this.amount = Number(_this.calculate.amountPayable)
//      }
//        _this.$forceUpdate()
                    var amount = Number(_this.calculate.amountPayable)
                    _this.amount = amount.toFixed(2)
                }
            },
            deliveryClick() {
                this.deliveryType = true
            },
            completeDelivery: function (e) {
                console.log(e)
                var _this = this
                this.deliveryType = false
                if (e.completeDelivery.title == '普通快递') {
                    _this.calculate.shippingMethod = 0
                    _this.shippingMethod = 0
                    _this.calculate.consignee = _this.address.consignee
                    _this.calculate.phone = _this.address.phone
                } else if (e.completeDelivery.title == '到店核销') {
                    _this.calculate.shippingMethod = 1
                    _this.shippingMethod = 1
                    _this.calculate.consignee = ''
                    _this.calculate.phone = ''
                } else if (e.completeDelivery.title == '同城配送') {
                    _this.calculate.shippingMethod = 2
                    _this.shippingMethod = 2
                    _this.calculate.consignee = _this.address.consignee
                    _this.calculate.phone = _this.address.phone
                }
                _this.delivery = e.completeDelivery
            },
            cencleDelivery() {
                this.deliveryType = false
            },
            couponsClick() {
                if (this.calculate.promotions.length == 0) {
                    eeui.toast('暂无优惠')
                } else {
                    this.couponsType = true
                }

            },
            cenclecoupons() {
                this.couponsType = false
            },
            check_shippingClick() {
                var _this = this
                if (this.isEmptyString(_this.calculate.receiverId)) {
                    eeui.toast('请选择收货地址')
                    return;
                }
                check_shipping(_this.calculate, {
                    receiverId: _this.calculate.receiverId
                }).then(
                    res => {
                        console.log(res)
                        if (res.data.length == 0) {
                            _this.createClick()
                        } else {
                            _this.check_shippingData = res.data
                            this.submitType = true;
                        }
                    }
                ).catch(error => {
                    eeui.toast(error.content)
                })
            },
            // 创建订单
            createClick() {
              console.log("1111111111111111111111111111111")
                var _this = this
                if (this.getGlobalData().token == null) {
                    const eeui = app.requireModule('eeui');
                    eeui.openPage({
                            url: 'root://pages/login/msgLogin.js',
                            statusBarType: 'immersion',
                            statusBarStyle: false
                        },
                        (result) => {
                            if (result.status == 'stop') {
                                if (_this.getGlobalData().token != null) {
                                    console.log('老哥进来了')
                                }
                            }
                        }
                    );
                } else {
                    if (_this.bomType == 1) {
                        if (_this.weexTime == '') {
                            eeui.toast('请选择配送时间')
                            return
                        } else {
                            _this.calculate.weekTime = _this.weexTime
                        }
                    }
                    _this.payType = true
                    console.log(_this.calculate.shippingMethod)
                    if (_this.calculate.shippingMethod == 1) {
                        if (this.isEmptyString(_this.calculate.phone)) {
                            eeui.toast('请输入提货人手机号')
                            _this.payType = false
                            return;
                        }
                        if (this.isEmptyString(_this.calculate.consignee)) {
                            eeui.toast('请输入提货人姓名')
                            _this.payType = false
                            return;
                        }
                        _this.calculate.receiverId = ''
                    } else {
                        if (this.isEmptyString(_this.calculate.receiverId)) {
                            eeui.toast('请选择收货地址')
                            _this.payType = false
                            return;
                        }
                    }
                    _this.calculate.shippingMethod = _this.shippingMethod
                    var form = eval(_this.calculate)
                    form.paymentVo.forEach(function (item) {
                        var vform = delete eval(item).chkType
                    })
                    var modal = weex.requireModule('modal')
                    modal.confirm({
                        message: `收货信息：${this.address.consignee} ${this.address.phone} \n${this.address.address}`,
                        duration: 0.3,
                        okTitle: "确定",
                        cancelTitle: "取消"
                    }, function (value) {
                        console.log('confirm callback', value)
                        if (value == "确定") {
                            //     }else{
                            //         modal.toast({
                            //             message: '请点击上方地址栏，进行收货地址修改',
                            //             duration: 0.3
                            //         })
                            //     }
                            // })
                            console.log("创建订单的信息")
                            console.log(form)
                            console.log(_this.getGlobalData().token)
                            console.log(_this.shippingMethod)
                            console.log("到订单创建前，没有问题")
                            console.log(_this.invitationcode)
                            eeui.loading();

                            console.log("999999999999999999999999999999999999999")
                          console.log(form)
                          console.log(_this.shippingMethod )
                          console.log( _this.getGlobalData().uuid)
                          console.log( _this.invitationcode )
                          console.log("999999999999999999999999999999999")


                          create(form, {
                                shippingMethod: _this.shippingMethod,
                                uuid: _this.getGlobalData().uuid,
                                code: _this.invitationcode
                            }).then(
                                res => {
                                    console.log("订单创建成功的返回信息")
                                    console.log(res)
                                    eeui.loadingClose();
                                    if (res.type == 'success') {
                                        _this.orderId = res.data.id
                                        if (res.data.paymentStatus == 1) {
                                            var data = {
                                                data: JSON.stringify(_this.calculate),
                                                id: _this.orderId
                                            }
                                            eeui.closePage()
                                            eeui.openPage({
                                                    params: data,
                                                    url: 'root://pages/goods/submit/complete.js',
                                                    statusBarType: 'immersion',
                                                    statusBarStyle: false
                                                },
                                                (result) => {

                                                }
                                            );
                                        } else {
                                            _this.paymentClick(res)
                                        }
                                    } else {
                                        eeui.loadingClose();
                                        _this.payType = false
                                    }
                                }
                            ).catch(error => {
                                _this.payType = false
                                eeui.loadingClose();
                                console.log("订单创建出错的返回信息")
                                console.log(error)
                            })
                        } else if (value == "取消") {
                            _this.payType = false
                            modal.toast({
                                message: '请点击上方地址栏，进行收货地址修改',
                                duration: 0.3
                            })
                        }
                    })
                }
            },
            returnClick() {
                this.submitType = false
            },
            completeClick() {
                var _this = this
                this.submitType = false
                _this.calculate.paymentVo.forEach(function (item) {
                    item.chk = false
                    item.amount = 0
                })
                _this.calculate.itemList.forEach(function (item, index) {
                    _this.check_shippingData.forEach(function (items) {
                        if (item.productId == items.productId) {
                            _this.calculate.itemList.splice(index, 1)
                        }
                    })
                })
                _this.calculateClick(_this.calculate)
            },
            paymentClick(data) {
                var _this = this
                payment(data.data.id).then(res => {
                    if (res.type == 'success') {
                        console.log('2支付')
                        console.log(res)
                        if (_this.alipayPay == true) {
                            _this.alipayClick(res)
                        } else if (_this.weixinPay == true) {
                            _this.weixinpayClick(res)
                        } else {
                            _this.unionPayClick(res)
                        }
                    } else {
                        eeui.toast('支付失败')
                        eeui.closePage()
                        eeui.openPage({
                                pageName: 'componentsOrder',
                                params: _this.orderId,
                                url: 'root://pages/member/order/details.js',
                                statusBarType: 'immersion',
                                statusBarStyle: false
                            },
                            (result) => {

                            }
                        );
                        console.log('支付失败1')
                    }
                }).catch(error => {
                    eeui.toast(error.content)
                    eeui.closePage()
                    eeui.openPage({
                            pageName: 'componentsOrder',
                            params: _this.orderId,
                            url: 'root://pages/member/order/details.js',
                            statusBarType: 'immersion',
                            statusBarStyle: false
                        },
                        (result) => {

                        }
                    );
                    console.log('支付失败2')
                })
            },
            weixinpayClick(data) {
                var _this = this
                console.log(data.data.sn)
                _this.sn = data.data.sn
                // wx.showLoading({
                //     title: '加载中...',
                // })
                submit({
                    paymentPluginId: 'weixinAppPayPlugin',
                    sn: data.data.sn
                }).then(res => {
                    console.info(res)
                    if (res.type == 'success') {
                        pay.weixin({
                            appid: res.data.appid,
                            partnerid: res.data.partnerid,
                            prepayid: res.data.prepayid,
                            package: res.data.package,
                            noncestr: res.data.noncestr,
                            timestamp: res.data.timestamp,
                            sign: res.data.paySign,
                        }, result => {
                            console.log(result, '微信支付查看')
                            if (result.status == 0) {
                                var data = {
                                    data: JSON.stringify(_this.calculate),
                                    id: _this.orderId
                                }
                                _this.queryClick(_this.sn)
                                eeui.closePage()
                                eeui.openPage({
                                        params: data,
                                        url: 'root://pages/goods/submit/complete.js',
                                        statusBarType: 'immersion',
                                        statusBarStyle: false
                                    },
                                    (result) => {

                                    }
                                );
                            } else if (result.status == -1) {
                                eeui.toast('服务器出错，请稍后重试')
                                eeui.closePage()
                                eeui.openPage({
                                        pageName: 'componentsOrder',
                                        params: _this.orderId,
                                        url: 'root://pages/member/order/details.js',
                                        statusBarType: 'immersion',
                                        statusBarStyle: false
                                    },
                                    (result) => {

                                    }
                                );
                                console.log('支付失败3')
                            } else if (result.status == -2) {
                                eeui.toast('您已取消支付')
                                eeui.closePage()
                                eeui.openPage({
                                        pageName: 'componentsOrder',
                                        params: _this.orderId,
                                        url: 'root://pages/member/order/details.js',
                                        statusBarType: 'immersion',
                                        statusBarStyle: false
                                    },
                                    (result) => {

                                    }
                                );
                                console.log('支付失败4')
                            } else if (result.status == -999) {
                                eeui.toast('开启微信失败')
                                eeui.closePage()
                                eeui.openPage({
                                        pageName: 'componentsOrder',
                                        params: _this.orderId,
                                        url: 'root://pages/member/order/details.js',
                                        statusBarType: 'immersion',
                                        statusBarStyle: false
                                    },
                                    (result) => {

                                    }
                                );
                                console.log('支付失败5')
                            }
                        })
                    } else {
                        eeui.toast('支付失败')
                        console.log('支付失败6')
                        eeui.closePage()
                        eeui.openPage({
                                pageName: 'componentsOrder',
                                params: _this.orderId,
                                url: 'root://pages/member/order/details.js',
                                statusBarType: 'immersion',
                                statusBarStyle: false
                            },
                            (result) => {

                            }
                        );
                    }
                }).catch(error => {
                    console.log(error)
                    eeui.toast('支付失败')
                    console.log('支付失败7')
                    eeui.closePage()
                    eeui.openPage({
                            pageName: 'componentsOrder',
                            params: _this.orderId,
                            url: 'root://pages/member/order/details.js',
                            statusBarType: 'immersion',
                            statusBarStyle: false
                        },
                        (result) => {

                        }
                    );
                })
            },

            unionPayClick(data){
                var _this = this
                console.log(data.data.sn)
                _this.sn = data.data.sn
                // wx.showLoading({
                //     title: '加载中...',
                // })
                console.log('云闪付')
                submit({
                    paymentPluginId: 'unionAppPayPlugin',
                    sn: data.data.sn
                }).then(res => {
                    console.info(res)
                    console.info('云闪付')
                    if (res.type == 'success') {
                        pay.unionPay({
                            tn: res.data.tn,
                            mode: '01'
                        }, result => {
                            console.log(result, '微信支付查看')
                            if (result.status == 0) {
                                var data = {
                                    data: JSON.stringify(_this.calculate),
                                    id: _this.orderId
                                }
                                _this.queryClick(_this.sn)
                                eeui.closePage()
                                eeui.openPage({
                                        params: data,
                                        url: 'root://pages/goods/submit/complete.js',
                                        statusBarType: 'immersion',
                                        statusBarStyle: false
                                    },
                                    (result) => {

                                    }
                                );
                            } else if (result.status == -1) {
                                eeui.toast('服务器出错，请稍后重试')
                                eeui.closePage()
                                eeui.openPage({
                                        pageName: 'componentsOrder',
                                        params: _this.orderId,
                                        url: 'root://pages/member/order/details.js',
                                        statusBarType: 'immersion',
                                        statusBarStyle: false
                                    },
                                    (result) => {

                                    }
                                );
                                console.log('支付失败3')
                            } else if (result.status == -2) {
                                eeui.toast('您已取消支付')
                                eeui.closePage()
                                eeui.openPage({
                                        pageName: 'componentsOrder',
                                        params: _this.orderId,
                                        url: 'root://pages/member/order/details.js',
                                        statusBarType: 'immersion',
                                        statusBarStyle: false
                                    },
                                    (result) => {

                                    }
                                );
                                console.log('支付失败4')
                            } else if (result.status == -999) {
                                eeui.toast('开启微信失败')
                                eeui.closePage()
                                eeui.openPage({
                                        pageName: 'componentsOrder',
                                        params: _this.orderId,
                                        url: 'root://pages/member/order/details.js',
                                        statusBarType: 'immersion',
                                        statusBarStyle: false
                                    },
                                    (result) => {

                                    }
                                );
                                console.log('支付失败5')
                            }
                        })
                    } else {
                        eeui.toast('支付失败')
                        console.log('支付失败6')
                        eeui.closePage()
                        eeui.openPage({
                                pageName: 'componentsOrder',
                                params: _this.orderId,
                                url: 'root://pages/member/order/details.js',
                                statusBarType: 'immersion',
                                statusBarStyle: false
                            },
                            (result) => {

                            }
                        );
                    }
                }).catch(error => {
                    console.log(error)
                    eeui.toast('支付失败')
                    console.log('支付失败7')
                    eeui.closePage()
                    eeui.openPage({
                            pageName: 'componentsOrder',
                            params: _this.orderId,
                            url: 'root://pages/member/order/details.js',
                            statusBarType: 'immersion',
                            statusBarStyle: false
                        },
                        (result) => {

                        }
                    );
                })
            },

            alipayClick(data) {
                var _this = this
                _this.sn = data.data.sn
                submit({
                    paymentPluginId: 'alipayAppPlugin',
                    sn: data.data.sn
                }).then(res => {
                    console.log('支付')
                    console.info(res)
                    if (res.type == 'success') {
                        pay.alipay(res.data.payData, result => {
                            console.log(result, '支付宝支付查看')
                            if (result.status == 9000) {
                                var data = {
                                    data: JSON.stringify(_this.calculate),
                                    id: _this.orderId
                                }
                                _this.queryClick(_this.sn)
                                eeui.closePage()
                                eeui.openPage({
                                        params: data,
                                        url: 'root://pages/goods/submit/complete.js',
                                        statusBarType: 'immersion',
                                        statusBarStyle: false
                                    },
                                    (result) => {

                                    }
                                );
                            } else if (result.status == 4000 || result.status == 6002 || result.status == '其他') {
                                eeui.toast('服务器出错，请稍后重试')
                                eeui.closePage()
                                eeui.openPage({
                                        pageName: 'componentsOrder',
                                        params: _this.orderId,
                                        url: 'root://pages/member/order/details.js',
                                        statusBarType: 'immersion',
                                        statusBarStyle: false
                                    },
                                    (result) => {

                                    }
                                );
                                console.log('支付失败3')
                            } else if (result.status == 5000) {
                                eeui.toast('重复请求')
                                eeui.closePage()
                                eeui.openPage({
                                        pageName: 'componentsOrder',
                                        params: _this.orderId,
                                        url: 'root://pages/member/order/details.js',
                                        statusBarType: 'immersion',
                                        statusBarStyle: false
                                    },
                                    (result) => {

                                    }
                                );
                                console.log('支付失败3')
                            } else if (result.status == 6001) {
                                eeui.toast('您已放弃支付')
                                eeui.closePage()
                                eeui.openPage({
                                        pageName: 'componentsOrder',
                                        params: _this.orderId,
                                        url: 'root://pages/member/order/details.js',
                                        statusBarType: 'immersion',
                                        statusBarStyle: false
                                    },
                                    (result) => {

                                    }
                                );
                                console.log('支付失败3')
                            } else if (result.status == 8000 || result.status == 6004) {
                                eeui.toast('查询出错，请刷新重试')
                                eeui.closePage()
                                eeui.openPage({
                                        pageName: 'componentsOrder',
                                        params: _this.orderId,
                                        url: 'root://pages/member/order/details.js',
                                        statusBarType: 'immersion',
                                        statusBarStyle: false
                                    },
                                    (result) => {

                                    }
                                );
                                console.log('支付失败3')
                            }
                        })
                    } else {
                        eeui.toast('支付失败')
                        console.log('支付失败6')
                        eeui.closePage()
                        eeui.openPage({
                                pageName: 'componentsOrder',
                                params: _this.orderId,
                                url: 'root://pages/member/order/details.js',
                                statusBarType: 'immersion',
                                statusBarStyle: false
                            },
                            (result) => {

                            }
                        );
                    }
                }).catch(error => {
                    console.log(error)
                    eeui.toast('支付失败')
                    console.log('支付失败7')
                    eeui.closePage()
                    eeui.openPage({
                            pageName: 'componentsOrder',
                            params: _this.orderId,
                            url: 'root://pages/member/order/details.js',
                            statusBarType: 'immersion',
                            statusBarStyle: false
                        },
                        (result) => {

                        }
                    );
                })
            },

            payClick(data) {
                var _this = this
                console.log(data)
                if (_this.weixinPay == true && data == 'weixinPay') {
                    _this.weixinPay = true
                    _this.tmies = new Date().getTime()
                } else if (_this.alipayPay == true && data == 'alipayPay') {
                    _this.alipayPay = true
                    _this.tmies = new Date().getTime()
                } else if (_this.unionPay == true && data == 'unionPay') {
                    _this.unionPay = true
                    _this.tmies = new Date().getTime()
                } else {
                    _this.weixinPay = false
                    _this.alipayPay = false
                    _this.unionPay = false
                    if (data == 'weixinPay') {
                        _this.weixinPay = true
                    } else if (data == 'alipayPay') {
                        _this.alipayPay = true
                    } else if (data == 'unionPay') {
                        _this.unionPay = true
                    }
                }
                console.log(_this.alipayPay)
            },
            queryClick(sn) {
                console.log('c查询')
                console.log(sn)
                query({
                    sn: sn
                }).then(
                    res => {
                        console.log(res)

                    }
                ).catch(error => {
                    console.log(res)
                })
            },
            //配送站点
            siteClick() {
                let _this = this
                shopList(this.calculate).then(
                    res => {
                        console.log("核销门店列表")
                        console.log(res)
                        _this.siteType = true
                        console.info(_this.$refs)
                        _this.$nextTick(() => {
                            _this.$refs.shippingSite1.loadList(res.data);
                        });
                    }
                ).catch(error => {
                    console.log(res)
                })
            },
            cencleSite() {
                this.siteType = false
            },
            completeSite(data) {
                var _this = this
                console.log(data)
                this.siteType = false
                this.shopId = data.from.id
                this.shopName = data.from.name
                this.shopIndex = data.shopIndex
                _this.calculate.shopId = data.from.id
                if (data.from.address != null) {
                    _this.shopAddress = data.from.address
                }
                if (data.from.areaName != null) {
                    _this.shopAreaName = data.from.areaName
                    console.log(JSON.stringify(_this.shopAreaName))
                }
            },
        }
    }
</script>
<style lang="css" src="../../../style/wx.css"/>
<style scoped>
    .app, body {
        background-color: rgba(248, 248, 248, 0.8);
    }

    .tabbar {
        flex: 1;
        width: 750px;
    }

    .navbar {
        width: 750px;
        height: 100px;
    }

    .text {
        font-size: 26px;
    }

    .address_box {
        width: 690px;
        /*height: 226px;*/
        background-color: rgba(255, 255, 255, 1);
        border-radius: 16px;
        margin-left: 30px;
        margin-top: 30px;
        position: relative;
        box-sizing: border-box;
        padding-left: 20px;
        padding-right: 20px;
        padding-top: 20px;
        padding-bottom: 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .address_img {
        width: 690px;
        height: 226px;
        position: absolute;
        bottom: -6px;
        left: 0;
    }

    .address_top {
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    .address_label {
        /*width: 66px;*/
        /*height: 34px;*/
        border-width: 2px;
        border-style: solid;
        border-color: rgba(231, 91, 83, 1);
        border-radius: 2px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 20px;
    }

    .address_label_item {
        width: 66px;
        height: 34px;
        background-color: rgba(231, 91, 83, 1);
        border-radius: 1px;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        border-width: 2px;
        border-style: solid;
        border-color: white;
    }

    .address_label_title {
        font-size: 20px;
        font-weight: 400;
        color: rgba(255, 255, 255, 1);
    }

    .address_name {
        font-size: 32px;
        font-weight: 500;
        color: rgba(26, 26, 30, 1);
        display: block;
        /*margin-left: 20px;*/
    }

    .address_phone {
        font-size: 28px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        opacity: 0.5;
        display: block;
        margin-left: 20px;
    }

    .address_content {
        width: 557px;
        /*height: 69px;*/
        font-size: 28px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        line-height: 42px;
        display: block;
        position: relative;
        margin-top: 10px;
    }

    .address_right {
        position: absolute;
        top: 0;
        right: 0px;
        bottom: 0px;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }

    .address_right_icon {
        font-size: 30px;
        color: #888888;
        width: 30px;
        height: 100px;
    }

    .submit_product {
        width: 690px;
        background-color: rgba(255, 255, 255, 1);
        border-radius: 16px;
        margin-top: 30px;
        margin-left: 30px;
        box-sizing: border-box;
        padding-top: 40px;
        padding-left: 25px;
        padding-right: 25px;
        padding-bottom: 20px;
        overflow: hidden;
    }

    .submit_product_content_box {
        display: flex;
        flex-direction: row;
        /* align-items: center; */
        position: relative;
        margin-bottom: 40px;
    }

    .submit_product_content_img {
        width: 170px;
        height: 170px;
        background: rgba(250, 250, 250, 1);
        border-radius: 4px;
    }

    .submit_product_content {
        display: flex;
        flex-direction: column;
        /* justify-content: center; */
        width: 320px;
        margin-left: 20px;
    }

    .submit_product_content_title {
        font-size: 28px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        line-height: 36px;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .submit_product_content_subtitle {
        font-size: 24px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        line-height: 36px;
        opacity: 0.3;
        /* margin-top: 16px; */
    }

    .submit_product_content_label {
        width: 134px;
        height: 34px;
        background: rgba(250, 243, 243, 1);
        border-radius: 1px;
        /* margin-top: 16px; */
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .submit_product_content_labelTitle {
        font-size: 20px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        line-height: 48px;
        opacity: 0.5;
    }

    .submit_product_number {
        position: absolute;
        right: 0;
        top: 0;
        display: flex;
        flex-direction: column;
    }

    .submit_product_priceIcon {
        font-size: 18px;
        font-weight: 400;
        color: red;
        line-height: 42px;
        display: block;
        height: 36px;
    }

    .submit_product_priceTitle {
        font-size: 28px;
        font-weight: 400;
        color: red;
        line-height: 36px;
        display: block;
    }

    .submit_product_yellow_priceIcon {
        font-size: 18px;
        font-weight: 400;
        color: orange;
        line-height: 42px;
        display: block;
        height: 36px;
    }

    .submit_product_yellow_priceTitle {
        font-size: 28px;
        font-weight: 400;
        color: orange;
        line-height: 36px;
        display: block;
    }

    .submit_product_quantity {
        font-size: 24px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        line-height: 28px;
        opacity: 0.5;
        text-align: right;
        display: block;
        width: 100%;
    }

    .submit_product_original_priceIcon {
        font-size: 14px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        line-height: 42px;
        opacity: 0.3;
        display: block;
        height: 36px;
    }

    .submit_product_original_priceTitle {
        font-size: 24px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        line-height: 36px;
        opacity: 0.3;
        display: block;
    }

    .submit_product_details {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-bottom: 20px;
    }

    .submit_product_details_title {
        width: 170px;
        display: block;
        font-size: 28px;
        text-align: right;
    }

    .submit_product_detailsBox {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        width: 450px;
        margin-left: 20px;
    }

    .submit_product_details_subtitle {
        font-size: 24px;
        color: rgba(26, 26, 30, 0.3);
    }

    .submit_product_details_Introduction {
        font-size: 24px;
        line-height: 26px;
        color: rgba(26, 26, 30, 1);
    }

    .submit_product_details_IntroductionTwo {
        font-size: 24px;
        line-height: 26px;
        color: rgba(231, 91, 83, 1);
    }

    .submit_product_details_Icon {
        font-size: 30px;
        color: #888888;
        width: 20px;
        height: 24px;
        padding-top: 2px;
        margin-left: 4px;
    }

    .submit_product_details_IconTwo {
        font-size: 24px;
        color: rgba(26, 26, 30, 0.3);
    }

    .submit_product_detailsBox_input {
        width: 450px;
        font-size: 28px;
        padding-bottom: 3px;
        height: 40px;

    }

    .submit_payMethod {
        width: 690px;
        padding: 25px;
        box-sizing: border-box;
        margin-left: 30px;
        margin-top: 30px;
        background-color: white;
        border-radius: 16px;
    }

    .submit_payMethod_Header_Title {
        font-size: 32px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
    }

    .submit_payMethod_Content {
        display: flex;
        justify-content: space-between;
        flex-direction: row;
        align-items: center;
        margin-top: 30px;
    }

    .submit_payMethod_Content_Column {
        display: flex;
        flex-direction: column;
        width: 540px;
    }

    .submit_payMethod_Content_Title {
        font-size: 28px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        display: block;
    }

    .submit_payMethod_Content_Title_code {
        font-size: 32px;
        font-weight: 400;
        color: red;
        display: block;
    }

    .submit_payMethod_Content_SubTitle {
        font-size: 24px;
        font-weight: 400;
        color: rgba(231, 91, 83, 1);
        line-height: 36px;
        display: block;
        margin-top: 10px;
    }

    .submit_payMethod_Content_Date {
        font-size: 24px;
        font-weight: 400;
        color: rgba(26, 26, 30, 0.3);
        line-height: 36px;
        /* display: block; */
        margin-top: 10px;
    }

    .submit_product_content_PreferentialPrice {
        font-size: 24px;
        font-weight: 500;
        color: rgba(231, 91, 83, 1);
        line-height: 36px;
        margin-right: 10px;
        /* display: block; *//* margin-top: 20px; */
    }

    .submit_product_content_row {
        display: flex;
        flex-direction: row;
        align-items: center;
        position: absolute;
        bottom: 0;
        left: 190px;
    }

    .submit_subtotal {
        width: 640px;
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
    }

    .submit_subtotal_subtitle {
        font-size: 24px;
        color: rgba(0, 0, 0, 0.5);
        margin-right: 5px;
        letter-spacing: 5px;
    }

    .submit_subtotal_title {
        font-size: 24px;
    }

    .submit_subtotal_Icon {
        font-size: 18px;
        color: rgba(231, 91, 83, 1);
        line-height: 30px;
        display: block;
        height: 30px;
    }

    .submit_subtotal_price {
        font-size: 24px;
        color: rgba(231, 91, 83, 1);
    }

    .submit_botton {
        width: 750px;
        height: 96px;
        background-color: rgba(248, 248, 248, 1);
        position: fixed;
        bottom: 0;
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        z-index: 999
    }

    .submit_botton_subtitle {
        font-size: 24px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        line-height: 36px;
        opacity: 0.5;
        margin-right: 5px;
        letter-spacing: 5px;
    }

    .submit_botton_price {
        font-size: 32px;
        font-weight: bold;
        color: rgba(231, 91, 83, 1);
        line-height: 36px;
        margin-right: 5px;
    }

    .submit_botton_icon {
        font-size: 24px;
        font-weight: bold;
        color: rgba(231, 91, 83, 1);
        line-height: 38px;
        display: block;
        height: 36px;
    }

    .submit_botton_box {
        width: 198px;
        height: 74px;
        /* background: linear-gradient(129deg, rgba(233, 88, 79, 1), rgba(241, 114, 80, 1)); */
        border-radius: 4px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: 10px;
        margin-right: 25px;
    }

    .submit_botton_box_no {
        width: 198px;
        height: 74px;
        background: linear-gradient(129deg, rgb(179, 178, 177), rgb(231, 231, 230));
        border-radius: 4px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: 10px;
        margin-right: 25px;
    }

    .submit_botton_box_title {
        font-size: 32px;
        font-weight: 400;
    }

    .address_no {
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    .address_no_img {
        width: 80px;
        height: 80px;
    }

    .address_no_title {
        font-size: 32px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        margin-left: 10px;
    }

    .submit_isMask {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.3);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9999;
    }

    .submit_isMask_content {
        width: 670px;
        background-color: rgba(255, 255, 255, 1);
        border-radius: 16px;
        padding-top: 70px;
        padding-left: 40px;
        padding-right: 40px;
        padding-bottom: 40px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
        overflow: scroll;
    }

    .submit_isMask_header {
        width: 413px;
        display: flex;
        justify-content: center;
        padding-bottom: 30px;
    }

    .submit_isMask_header_title {
        font-size: 32px;
        font-weight: 500;
        color: rgba(26, 26, 30, 1);
        line-height: 42px;
        text-align: center;
    }

    .submit_isMask_product {
        display: flex;
        flex-direction: row;
        margin-bottom: 30px;
    }

    .submit_isMask_product_img {
        width: 170px;
        height: 170px;
        background-color: rgba(250, 250, 250, 1);
        border-radius: 4px;
    }

    .submit_isMask_product_column {
        display: flex;
        flex-direction: column;
        margin-left: 20px;
        width: 400px;
    }

    .submit_isMask_product_title {
        font-size: 24px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        line-height: 36px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-box-orient: vertical;
    }

    .submit_isMask_product_subtitle {
        font-size: 24px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        line-height: 36px;
        opacity: 0.3;
        margin-top: 16px;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

    .submit_isMask_product_quantity {
        font-size: 24px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        line-height: 36px;
        opacity: 0.5;
        margin-top: 16px;
    }

    .isMask_botton {
        width: 670px;
        height: 158px;
        border-top-style: solid;
        border-top-width: 1px;
        border-top-color: rgba(0, 0, 0, 0.05);
        position: absolute;
        bottom: 0;
        left: 0;
        padding-left: 40px;
        padding-right: 40px;
        box-sizing: border-box;
        justify-content: space-between;
        align-items: center;
        display: flex;
        flex-direction: row;
        background-color: white;
    }

    .isMask_botton_left {
        width: 272px;
        height: 74px;
        background-image: linear-gradient(to bottom, rgba(196, 198, 204, 1), rgba(213, 215, 219, 1));
        border-radius: 4px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .isMask_botton_left_title {
        font-size: 32px;
        font-weight: 400;
        color: rgba(255, 255, 255, 1);
    }

    .isMask_botton_right {
        width: 282px;
        height: 74px;
        /* background: linear-gradient(129deg, rgba(233, 88, 79, 1), rgba(241, 114, 80, 1)); */
        border-radius: 4px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .isMask_botton_right_title {
        font-size: 32px;
        font-weight: 400;
        /* color: rgba(255, 255, 255, 1); */
    }

    .submit_payMethod_Content_Row {
        display: flex;
        flex-direction: row;
    }

    .submit_payMethod_Content_botton {
        width: 30px;
        height: 30px;
        border-radius: 50%;
    }

    .submit_payMethod_ContentTwo {
        display: flex;
        justify-content: space-between;
        flex-direction: row;
        align-items: center;
    }

    .submit_payMethod_Content_Img {
        width: 30px;
        height: 30px;
        margin-right: 20px;
    }

    .submit_package {
        width: 690px;
        padding: 25px;
        box-sizing: border-box;
        margin-left: 30px;
        margin-top: 30px;
        background-color: white;
        border-radius: 16px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between
    }

    .submit_payMethod_Content_Title {
        font-size: 32px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        display: block;
    }

    .shop_box {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .shop_title {
        font-size: 32px;
    }

    .shop_name {
        font-size: 28px;
        color: rgba(26, 26, 30, 0.3);
        text-align: right;
    }

    .phone_input {
        width: 414px;
        font-size: 28px;
        font-weight: 400;
        color: rgba(26, 26, 30, 1);
        line-height: 48px;
        opacity: 0.4;
        border-bottom-color: #ccc;
        border-bottom-style: solid;
        border-bottom-width: 1px;
        padding-left: 10px;
    }
</style>
